package com.amigo.online.consumer.user.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import com.amigo.online.common.core.response.Response;
import com.amigo.online.common.param.dto.group.AddGroupMemberDto;
import com.amigo.online.common.param.dto.group.EditGroupDto;
import com.amigo.online.common.param.dto.group.NewGroupDto;
import com.amigo.online.common.param.dto.group.QuitGroupDto;
import com.amigo.online.common.param.dto.group.UpdateGroupDto;

@FeignClient(name = "amigo-online-provider-user")
public interface GroupService {

	@RequestMapping(value = "/group/newGroup", method = RequestMethod.POST)
	ResponseEntity<Response> newGroup(NewGroupDto dto);
	
	@RequestMapping(value = "/group/quitGroup", method = RequestMethod.PUT)
	ResponseEntity<Response> quitGroup(QuitGroupDto dto);

	@RequestMapping(value = "/group/editGroup", method = RequestMethod.PUT)
	ResponseEntity<Response> editGroup(EditGroupDto dto);

	@RequestMapping(value = "/group/getPullableFriends/{groupId}", method = RequestMethod.GET)
	ResponseEntity<Response> getPullableFriends(@PathVariable("groupId") Long groupId);

	@RequestMapping(value = "/group/addGroupMember", method = RequestMethod.POST)
	ResponseEntity<Response> addGroupMember(AddGroupMemberDto dto);

	@RequestMapping(value = "/group/getMyGroup", method = RequestMethod.GET)
	ResponseEntity<Response> getMyGroup();

	@RequestMapping(value = "/group/getMembers/{groupId}/{page}/{size}", method = RequestMethod.GET)
	ResponseEntity<Response> getMembersByGroupId(@PathVariable("groupId")Long groupId, @PathVariable("page")Integer page,  @PathVariable("size")Integer size);

	@RequestMapping(value = "/group/getMembers/{groupId}", method = RequestMethod.GET)
	ResponseEntity<Response> getMembersCountByGroupId(Long groupId);

	@RequestMapping(value = "/group/updateGroup", method = RequestMethod.POST)
	ResponseEntity<Response> updateGroup(UpdateGroupDto dto);

	@RequestMapping(value = "/group/nearby/{page}", method = RequestMethod.GET)
	ResponseEntity<Response> nearbyGroup(@PathVariable Integer page,
										 @RequestHeader("lng") String lng,
										 @RequestHeader("lat") String lat);
}
